#include "clampSide.h"
#include "../framework.h"

Vertexf ClampSide::vertices[] ={ 	Vertexf(-0.25f,-0.5f),Vertexf(0.0f,0.0f),
									Vertexf(-0.25f,0.5f),Vertexf(-0.5f,0.0f)};

ClampSide::ClampSide()
	: 	SceneObject(){
	this->rotationAngle = 0.0f;
	this->objVertices.vertices = vertices;
	this->objVertices.nVertices = nVertices;
	this->rotationAngle = 0;
}

ClampSide::~ClampSide(){
}

void ClampSide::draw(){
	Framework& fr = Framework::instance();
	Colorf old = fr.pipeline.getFillColor();
	fr.pipeline.pushMatrix();
		fr.pipeline.translate(-0.25f,0.25f);
		fr.pipeline.rotate(-this->rotationAngle);
		fr.pipeline.setFillColor(Colorf(0.0f,0.0f,0.0f));
		fr.pipeline.draw(Pipeline::POLYGON,objVertices.vertices,objVertices.nVertices);

		fr.pipeline.pushMatrix();
			fr.pipeline.escale(0.8f,0.8f);
			fr.pipeline.setFillColor(old);
			fr.pipeline.draw(Pipeline::POLYGON,objVertices.vertices,objVertices.nVertices);
		fr.pipeline.popMatrix();
	fr.pipeline.popMatrix();
	fr.pipeline.setFillColor(old);
}
